Roll a Character Using the Trust-to-Luck Method

Charlie Veniot 25th September 2022 at 2:06am
1 REM ** Roll a Character Using the Trust-to-Luck Method **
2 ' GW-BASIC Made Easy, Chapter 7. File: GWME0711.BAS
100 REM ** Define a function to 'roll' 3D6 **
110 DEF FNroll3D6 = INT(6 * RND) + INT(6 * RND) + INT(6 * RND) + 3
200 REM ** Set up **
210 CLS : KEY OFF
220 RANDOMIZE TIMER
300 REM ** Get ready to roll **
310 CLS
320 PRINT "Here is a character:"
330 PRINT
400 REM ** Roll 3D6 for each of 7 characteristics **
410 PRINT "Strength", FNroll3D6
420 PRINT "Constitution", FNroll3D6
430 PRINT "Size", FNroll3D6
440 PRINT "Intelligence", FNroll3D6
450 PRINT "Intuition", FNroll3D6
460 PRINT "Dexterity", FNroll3D6
470 PRINT "Appearance", FNroll3D6
500 REM ** Tell how to do again **
510 PRINT
520 PRINT "Press a key for another, or ESC to quit"
530 anykey$ = INPUT$(1)
540 IF anykey$ <> CHR$(27) THEN 310 ELSE END